<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;

class IndexController extends CommonController {
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index () {
        $envs = [
            ['name' => 'PHP version', 'value' => 'PHP/' . PHP_VERSION],
            ['name' => 'Laravel version', 'value' => app()->version()],
            ['name' => 'CGI', 'value' => php_sapi_name()],
            ['name' => 'Uname', 'value' => php_uname()],
            ['name' => 'Server', 'value' => Arr::get($_SERVER, 'SERVER_SOFTWARE')],

            ['name' => 'Cache driver', 'value' => config('cache.default')],
            ['name' => 'Session driver', 'value' => config('session.driver')],
            ['name' => 'Queue driver', 'value' => config('queue.default')],

            ['name' => 'Timezone', 'value' => config('app.timezone')],
            ['name' => 'Locale', 'value' => config('app.locale')],
            ['name' => 'Env', 'value' => config('app.env')],
            ['name' => 'URL', 'value' => config('app.url')],
        ];

        $pageData = [
            'sideNav' => [
                'components' => [
                    'title' => '组件 Component',
                    'children' => [
                        [ 'title' => '对话框 Dialog', 'children' => [] ],
                        [ 'title' => '轻量提示 Toast', 'children' => [] ],
                        [
                            'title' => 'Three Level Menu',
                            'children' => [
                                [
                                    'title' => '对话框 Dialog', 'children' => []
                                ],
                            ]
                        ],
                    ]
                ]
            ]
        ];

        return view('admin.layouts.index', compact('envs', 'pageData'));
    }

    public function dashboard () {
        return view('admin.dashboard.index');
    }

    public function test (Request $request){
        dd($request);
    }


}
